package com.designmodel.atcion.strategy;

/**
 * 策略模式
 *
 * @author think
 * @version 1.0.0
 * @since 2020/4/22
 */
public class StrategyTest {

    public static void main(String[] args) {
        String exp = "8+8";
        AbstractCalculator cal = new Plus();
        int result = cal.calculate(exp, "\\+");
        System.out.println(result);

        exp = "8*8";
        cal = new Multiply();
        result = cal.calculate(exp, "\\*");
        System.out.println(result);

        exp = "8-8";
        cal = new Minus();
        result = cal.calculate(exp, "-");
        System.out.println(result);
    }
}
